#include <stdio.h>
#include <string.h>

int main(){
    FILE* file = fopen("hello.txt","r");
    if(!file){
        return -1;
    }

    FILE* fp = fopen("hello_copy.txt","w");
    if(!fp){
        return -1;
    }

    char buffer[6] = {0};
    int bytes_read ;
    while((bytes_read = fread(buffer,1,5,file)) > 0){
        buffer[5] = '\0';
        printf("bytes_read is %d\n", bytes_read);
        //printf("%s\n",buffer);
        fwrite(buffer,1,bytes_read,fp);
        memset(buffer, 0, 6);
    }

    fclose(file);
    fclose(fp);
    return 0;
}